package edu.xust.service.impl;

import edu.xust.config.Resource;
import edu.xust.config.Service;
import edu.xust.dao.AuditsDao;
import edu.xust.dto.BaseDto;
import edu.xust.dto.MessageEnum;
import edu.xust.entity.Audits;
import edu.xust.entity.AuditsExample;
import edu.xust.page.PageInfo;
import edu.xust.service.AuditsService;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @auther: zhangxin
 * @Description:
 */
@Service("auditsService")
public class AuditsServiceImpl implements AuditsService {

    @Resource
    AuditsDao auditsDao;


    @Override
    public BaseDto selectAuditsByAdidAndByPage(PageInfo pageInfo) {
        List<Audits> audits = auditsDao.selectAuditsByAdidAndByPage(pageInfo);
        audits.stream().forEach(audit -> audit.setAustatusstring("已审核"));
        System.out.println(audits+".....au");
        System.out.println(pageInfo+".....pa");
        BaseDto baseDto = new BaseDto(MessageEnum.ADDADMINSUCCESS,audits);
        baseDto.setObj(pageInfo);
        return baseDto;
    }
}
